package com.kezesong.leasing.common.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * '交易状态 0=未支付， 1=已支付，2=已取消',
 */
public enum OrderTradeStatusEnum {
    WAITTINGG_PAY(0,"未支付"),
    HAS_PAY(1,"已支付"),
    CANCEL_PAY(2,"已取消");

    private int code;
    private String desc;
    private static Map<Integer, String> returnCodeMap;

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static Map<Integer, String> getReturnCodeMap() {
        return returnCodeMap;
    }

    OrderTradeStatusEnum(int code, String desc){
        this.code = code;
        this.desc = desc;
    }

    static {
        returnCodeMap = new HashMap<>();
        for (OrderTradeStatusEnum returnCodeEnum : OrderTradeStatusEnum.values()){
            returnCodeMap.put(returnCodeEnum.getCode(), returnCodeEnum.getDesc());
        }
    }
}
